<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org" >
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>MyStore | 一站式应用解决方案</title>
    <!-- 引入 Bootstrap 样式库 -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css">
    <!-- 引入自定义样式 -->
    <style>
        .col a{
            text-decoration: none;
            color: black;
        }
        .platform {
            display: inline;
        }
    </style>
</head>
<body>
<!-- 导航栏 -->
<nav class="navbar navbar-expand-lg navbar-light bg-light">
    <div class="container-fluid">
        <a class="navbar-brand" th:href="@{/}">MyStore</a>
        <!-- 搜索框 -->
        <form class="d-flex" method="get" th:action="@{/console/app/search.do}">
            <input class="form-control form-control-lg" type="search" name="data" placeholder="搜索应用" aria-label="Search">
            <button class="btn btn-primary" type="submit">搜索</button>
        </form>
        <!-- 用户图标 -->
        <a href="" th:href="@{/console/user/userCenter.do(userId=*{session.userId})}" onclick="">
            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-person" viewBox="0 0 16 16">
                <path d="M8 8.112a2.112 2.112 0 1 1 0-4.224 2.112 2.112 0 0 1 0 4.224zm0 1.063c-2.08 0-6.4 1.052-6.4 3.168V14h12.8v-1.657c0-2.116-4.32-3.168-6.4-3.168z"/>
                <path fill-rule="evenodd" d="M8 9a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0-1.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z"/>
            </svg>
        </a>
    </div>
</nav>
<!-- 应用详情 -->


<!-- 应用详情界面主要内容 -->
<div class="row">
    <div class="col-md">
        <div class="card mt-8">
            <div class="card-body">
                <h4 class="card-title" th:text="${app.appName}"></h4>
                <p class="card-text" th:text="${app.appDescription}"></p>
                <div class="d-flex flex-wrap align-items-center justify-content-start mb-4">
                    <div class="me-4" th:if="${app.appModelList != null&&!app.appModelList.isEmpty()}">
                        <span class="badge bg-secondary" th:each="appModel:${app.appModelList}">
                            <p class="platform" th:text="${appModel.appPlatform}"></p>
                        </span>
                    </div>
                    <div>
                        <span class="badge bg-light text-dark" th:text="'下载次数：'+${app.downloadCount}"></span>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-7">
                        <img src="" style="width: 100px;height: 100px" class="card-img-top" alt="..." th:src="@{/console/file/image.do(fileModelId=${app.appIcon})}">
                    </div>
                    <div class="col-md-5" th:if="${app.appModelList != null&&!app.appModelList.isEmpty()}">
                        <h5 class="card-title mt-3 mt-md-0" th:text="'下载'+${app.appName}" ></h5>
                        <p class="card-text" th:text="'点击下面适用平台的按钮下载 '+${app.appName}"></p>
                        <div class="mt-4 mb-3">
                            <span th:each="appModel:${app.appModelList}">
                                <a href="" th:href="@{/console/file/download.do(fileModelId=${appModel.fileModelId},appId=${app.appId})}" class="btn btn-primary d-block mb-2"  th:text="${appModel.appPlatform}+':'+${appModel.appVersion}"></a>
                            </span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
<div class="row">
    <div class="col-md">
        <h5 class="mt-8 mb-3">应用截图</h5>
        <div class="d-flex" th:each="image:${app.getImages()}">
            <img src="" th:src="@{/console/file/image.do(fileModelId=${image})}" class="flex-fill me-2 mb-2 mb-md-0" alt="...">
        </div>
    </div>
</div>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<!-- 引入 Bootstrap JavaScript 库 -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>

